package cn.richard.demo.xml.bean;

import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@XmlRootElement(name = "Document") //根元素
@XmlAccessorType(XmlAccessType.FIELD)
public class Student {
	@XmlAttribute
	private String type;
	@XmlAttribute
	private String xmlns;
	@XmlAttribute(name = "xmlns:xsi")
	private String xmlnscolonxsi;
	
	private Integer id;
	private String name;
	private Integer age;

	private Eye eye;
	
	//兴趣s
	@XmlElementWrapper(name = "hobbies")
	private List<Hobby> hobby;

	public Student(Integer id, String name, Integer age) {
		super();
		this.id = id;
		this.name = name;
		this.age = age;
	}
}

